/**
 * 解析url参数
 * @param url URL地址
 * @returns
 */
export const urlToObj = (url: string) => {
  const [, params] = url.split('?');
  return params.split('&').reduce((acc: Record<string, string>, cur) => {
    const [key, value] = cur.split('=');
    acc[key] = value;
    return acc;
  }, {});
};
